/*! \file profile_section.h
 *	\brief <write description for profile_section.h>
 *
 *	created:	2009/11/20
 *	created:	20:11:2009   18:27
 *	filename: 	o:\main\libs\mem\profile_section.h
 *	file path:	o:\main\libs\mem
 *	file base:	profile_section
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _MEM_PROFILE_SECTION_H_
#define _MEM_PROFILE_SECTION_H_

#pragma once

#include "defs.h"

#if TT_MEM_ENABLED && TT_MEM_PROFILING

namespace tt{
namespace mem{

namespace impl{
class BlockInfo;
} //impl

//////////////////////////////////////////////////////////////////////////
namespace starters{

class Normal
{
public:
	static void section_start(const char* section_name, impl::BlockInfo*& section, impl::BlockInfo*& previous);
};

class ToRoot
{
public:
	static void section_start(const char* section_name, impl::BlockInfo*& section, impl::BlockInfo*& previous);
};

} //section_creation

//////////////////////////////////////////////////////////////////////////
template<class SectionCreator>
class MEM_API ProfileSection
{
public:
	ProfileSection(const char* section_name);
	~ProfileSection();

private:
	impl::BlockInfo* m_section;
	impl::BlockInfo* m_previous;
};

} //mem
} //namespace tt

#endif //TT_MEM_ENABLED && TT_MEM_PROFILING

#endif //_MEM_PROFILE_SECTION_H_
